<template>
	<view>
		<view class="item">
			<u--form labelPosition="left" :model="info" :rules="rules" ref="uForm">
				<view style="padding: 20rpx;">
					<u-form-item label="选择微信用户" prop="wechat" :labelWidth="labelWidth" required labelPosition="left" :borderBottom="true">
						<input placeholder="请选择" v-model="info.wechat"/>
					</u-form-item>
					<u-form-item label="姓名" prop="name" :labelWidth="labelWidth" required labelPosition="left" :borderBottom="true">
						<input placeholder="请输入" v-model="info.name"/>
					</u-form-item>
					<u-form-item label="上传二维码" prop="name" :labelWidth="labelWidth"  labelPosition="top" >
						<u-upload
						style="margin-top: 20rpx;"
								:fileList="fileList1"
								@afterRead="afterRead"
								@delete="deletePic"
								name="1"
								multiple
								:maxCount="10"
							></u-upload>
					</u-form-item>
				</view>
			</u--form>	
		</view>
		<view style="height: 150rpx;"></view>
		<view class="bottom row-center">
			<view class="btn row-center" @click="submit">确定</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				labelWidth:120,
				info:{
					'wechat':'',
					'name':'',
					'code':''
				},
				rules: {
					'name': {
						type: 'string',
						required: true,
						message: '请输入活动名称',
						trigger: ['blur', 'change']
					},
					}
			}
		},
		methods: {
			goAdd(){
				uni.navigateTo({
					url:'/src/pages/merchant_index/add_shop'
				})
			},
			submit() {
				this.$refs.uForm.validate().then(res => {
					uni.$u.toast('校验通过')
				}).catch(errors => {
					uni.$u.toast('校验失败')
				})
			},
		}
	}
</script>
<style>
	page{
		background: #F2F3F8;
	}
</style>
<style scoped lang="scss">
	.bottom {
		width: 100%;
		bottom: 0;
		position: fixed;
		height: 120rpx;
		background: #FFF;
	
		.btn {
			height: 80rpx;
			width: calc(100% - 72rpx);
			margin-left: 36rpx;
			margin-right: 36rpx;
			border-radius: 40rpx;
			background: #3B60D3;
			color: #FFF;
			font-size: 32rpx;
			font-style: normal;
			font-weight: 500;
			line-height: 48rpx;
			/* 150% */
		}
		}
	.item{
		padding: 24rpx;
		background-color: white;
	}
</style>
